package com.stateflow.engine.user.web;

import com.stateflow.engine.user.biz.service.StateFlowService;
import com.stateflow.facade.common.model.res.CommonResult;
import com.stateflow.facade.common.util.CreateRequestUtils;
import com.stateflow.facade.dto.req.GetOperatorListRequestDTO;
import com.stateflow.facade.dto.req.StateFlowRequestDTO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * Created by weiqingming on 2019/12/12.
 * 状态流转
 */
@RestController
@RequestMapping(value = "/stateflow/")
public class StateFlowController {

    @Resource
    private StateFlowService stateFlowService;

    @RequestMapping(value = "stateFlow.json",method = RequestMethod.POST)
    @ResponseBody
    public CommonResult stateFlow(@RequestBody StateFlowRequestDTO param){
        return stateFlowService.stateFlow(CreateRequestUtils.createByInside(param));
    }


    @RequestMapping(value = "getOperatorList.json",method = RequestMethod.POST)
    @ResponseBody
    public CommonResult getOperatorList(@RequestBody GetOperatorListRequestDTO param){
        return stateFlowService.getOperatorList(CreateRequestUtils.createByInside(param));
    }
}
